#include <cstdio>
#include <algorithm>

using namespace std;

const int maxn = 510;
const int INF = 1000000000;

struct Station {
	double price;
	double distance;
}sta[maxn];

bool cmp(Station a, Station b) {
	return a.distance < b.distance;
}

int main() {
	int n;
	double Cmax, D, Davg;
	scanf("%lf%lf%lf%d", &Cmax, &D, &Davg, &n);
	for (int i = 0; i < n; i++) {
		scanf("%lf%lf", &sta[i].price, &sta[i].distance);
	}
	sta[n].price = 0;
	sta[n].distance = D;

	sort(sta, sta+n, cmp);
	
	if (sta[0].distance != 0) {
		printf("The maximum travel distance = 0.00\n");
		return 0;
	}
	
	int now = 0;
	double ans = 0, nowTank = 0, MAX = Cmax * Davg;
	while (now < n) {
		int k = -1;
		double priceMin = INF;
		for (int i = now+1; i<=n && sta[i].distance-sta[now].distance<=MAX; i++) {
			if (sta[i].price < priceMin) {
				priceMin = sta[i].price;
				k = i;
				if (priceMin < sta[now].price)
					break;
			}
		}
		if (k == -1)
			break;
		double need = (sta[k].distance - sta[now].distance) / Davg;
		if (priceMin < sta[now].price) {
			if (nowTank < need) {
				ans += (need - nowTank) * sta[now].price;
				nowTank = 0;
			} else {
				nowTank -= need;
			}
		} else {
			ans += (Cmax-nowTank) * sta[now].price;
			nowTank = Cmax - need;
		}
		now = k;
	}

	if (now == n) {
		printf("%.2f\n", ans);
	} else {
		printf("The maximum travel distance = %.2f\n", sta[now].distance+MAX);
	}

	return 0;
}

